using System;
using Microsoft.SPOT;

namespace Microsoft.NETMF.BikeComputer.Application
{

    public class Settings
    {
        private string settingsLabel;
        public string Label
        {
            get
            {
                return settingsLabel;
            }
        }

        public Settings(string label)
        {
            settingsLabel = label;
        }

    }

    public class TireSize : Settings
    {
        public double Circumference;
        public TireSize(string label, double circ)
            : base(label)
        {
            Circumference = circ;
        }
    }

    public class Units : Settings
    {
        public Units(string label)
            : base(label)
        {
        }

    }


    public class SettingsTable
    {
        private Settings[] settingTableData_;
        private int settingIndex_;
 
        public SettingsTable(Settings[] tableData)
        {
            settingTableData_ = tableData;
            settingIndex_ = 0;

        }

        public Settings Current()
        {
            return settingTableData_[settingIndex_];
        }

        public Settings Next()
        {
            settingIndex_++;
            if (settingIndex_ >= settingTableData_.Length)
            {
                settingIndex_ = 0;
            }
            return settingTableData_[settingIndex_];
        }

        public Settings Previous()
        {
            settingIndex_--;
            if (settingIndex_ < 0)
            {
                settingIndex_ = settingTableData_.Length - 1;
            }
            return settingTableData_[settingIndex_];
        }
    }


}
